Accessing Submitted Data in Ajax Callbacks

Description

Control names can be quickly inserted while implementing an Xbasic function that handles an Ajax Callback using the Insert Submitted Data Control Name dialog.

Discussion

Xbasic functions that handle an Ajax callback often need to read values from one or more UX controls. For example, a callback could lookup some customer data in a database and populate other controls in the UX. In order to query the database, however, you need to know which customer was selected in the customer dropdown, which is available in the e.dataSubmitted object:

dim selectedCustomer as c = e.dataSubmitted.customerList

You can insert the code necessary to read the submitted value for a UX control using the new Insert Submitted Data Control Name dialog. This dialog is opened when you press Ctrl+D while the Xbasic Functions code editor has focus. The dialog displays a list of controls defined in the UX.

When you make your selection, the control name is inserted into the code at the current insertion point. If Add 'e.datasubmitted.' as a prefix is checked, the fully qualified variable name for the submitted data is inserted.

Insert Submitted Data Control Name window
Insert Submitted Data Control Name window